xen: add real time scheduler rtds
authorMeng Xu <mengxu@cis.upenn.edu>
Sat, 20 Sep 2014 22:13:48 +0000 (18:13 -0400)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 23 Sep 2014 13:39:18 +0000 (14:39 +0100)
commit8726c0557752104cca4d046fab8ac389f881a285
tree0ab5c155479aa3a572796b965d8c2c1c36241b40
parente9d6c685b15b728d13f6ff4eaaf33604ef0a0e89
xen: add real time scheduler rtds

This scheduler follows the Preemptive Global Earliest Deadline First
(EDF) theory in real-time field.
At any scheduling point, the VCPU with earlier deadline has higher
priority. The scheduler always picks the highest priority VCPU to run on a
feasible PCPU.
A PCPU is feasible if the VCPU can run on this PCPU and (the PCPU is
idle or has a lower-priority VCPU running on it.)

Each VCPU has a dedicated period and budget.
The deadline of a VCPU is at the end of each period;
A VCPU has its budget replenished at the beginning of each period;
While scheduled, a VCPU burns its budget.
The VCPU needs to finish its budget before its deadline in each period;
The VCPU discards its unused budget at the end of each period.
If a VCPU runs out of budget in a period, it has to wait until next period.

Each VCPU is implemented as a deferable server.
When a VCPU has a task running on it, its budget is continuously burned;
When a VCPU has no task but with budget left, its budget is preserved.

Queue scheme:
A global runqueue and a global depletedq for each CPU pool.
The runqueue holds all runnable VCPUs with budget and sorted by deadline;
The depletedq holds all VCPUs without budget and unsorted.

Note: cpumask and cpupool is supported.

This is an experimental scheduler.

Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
Signed-off-by: Sisu Xi <xisisu@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Tested-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
[ ijc -- use PRI_stime to print delta in burn_budget, to fix build on
         32-bit (i.e. arm32) ]
xen/common/Makefile
xen/common/sched_rt.c [new file with mode: 0644]
xen/common/schedule.c
xen/include/public/domctl.h
xen/include/public/trace.h
xen/include/xen/sched-if.h